package com.live.proxy.tool;

import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;

import org.json.JSONObject;

public class GetUtil {

    public static String TAG = "---云代理----";

    public static String ServerU(){
        return "http://后台域名/proxyapi/";
    }

    public static String userPassLogin(){return ServerU()+"Login/proxyPassLogin";}//密码登录
    public static String updateNickname(){return ServerU()+"UserMy/updateNickname";}//更改昵称
    public static String updatePassword(){return ServerU()+"UserMy/updatePassword";}//更改密码
    public static String ProxyAppinfo(){return ServerU()+"UserMy/getUpdate";}//版本更新
    public static String getInteYue(){return ServerU()+"UserMy/getInteYue";}//获取账户余额

    public static String getProxyList(){return ServerU()+"ManageProxy/getProxyList";}//代理列表
    public static String addProxyUser(){return ServerU()+"ManageProxy/addProxyUser";}//新增代理
    public static String addProxyInte(){return ServerU()+"ManageProxy/addProxyInte";}//下发积分

    public static String getThaliIndustryList(){return ServerU()+"ManageUser/getThaliIndustryList";}//获取套餐行业列表
    public static String getUserList(){return ServerU()+"ManageUser/getUserList";}//用户列表
    public static String addUser(){return ServerU()+"ManageUser/addUser";}//新增用户
    public static String reUserVip(){return ServerU()+"ManageUser/reUserVip";}//续费

    public static String getUserAiQa(){return ServerU()+"ManageUser/getUserAiQa";}//获取AI问答加购信息
    public static String reUserAiQa(){return ServerU()+"ManageUser/reUserAiQa";}//AI问答加购
    public static String getUserAiTrain(){return ServerU()+"ManageUser/getUserAiTrain";}//获取AI训练加购信息
    public static String reUserAiTrain(){return ServerU()+"ManageUser/reUserAiTrain";}//AI训练加购

    public static String getInteList(){return ServerU()+"ManageIntegral/getInteList";}//积分记录

    public static String getInteThaliList(){return ServerU()+"ManageOrder/getInteThaliList";}//积分套餐列表
    public static String getOrderList(){return ServerU()+"ManageOrder/getOrderList";}//订单列表
    public static String createOrder(){return ServerU()+"ManageOrder/createOrder";}//创建订单
    public static String cancelOrder(){return ServerU()+"ManageOrder/cancelOrder";}//取消订单
    public static String deleteOrder(){return ServerU()+"ManageOrder/deleteOrder";}//删除订单

    //获取当前app名称和包名
    public static JSONObject getAppInfo(Context context){
        JSONObject json = new JSONObject();
        try {
            PackageManager packageManager = context.getPackageManager();
            PackageInfo packageInfo = packageManager.getPackageInfo(context.getPackageName(), 0);
            json.put("appName",packageInfo.applicationInfo.loadLabel(packageManager).toString());
            json.put("packageName", packageInfo.packageName);
            json.put("versionName",packageInfo.versionName);
            json.put("versionCode",packageInfo.versionCode);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return json;
    }
}
